Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
Webpack [contenthash] parse in files

I will do versioning via hashing. And this with Webpack.

Content of: webpack.config.js

...
output: {
    path: path.resolve(__dirname, 'web/dist'),
    filename: '[name].[contenthash].js',
},
...

webpack generate some files, i think its okay, its a hash... app.d471b97fd69a6837f5bf.js

In my index.html file must replace the filenames to, i do it with "replacer-contenthash-webpack-plugin" Plugin for Webpack. It used the loaderUtils.getHashDigest(buffer) do generate a hash. But its not the same its generate this 174d0b0d04495cf7a970 hash.

Content of: index.html <script src="dist/app.174d0b0d04495cf7a970.js"></script>

how can i fix it? I dont no how webpack generate the hash with [hashcode]. Its not specified.

i have tried, to specified contenthash digest, length and function:

output: {
    path: path.resolve(__dirname, 'web/dist'),
    filename: '[name].[contenthash].js',
    hashFunction: "md5",
    hashDigest: "hex",
    hashDigestLength: 32
},

and specified the used Webpack extension getHashDigest() so:

getHashDigest(buffer, "md5", "hex", 32)

=> app.54949ecc3046a8e7e56e8d9875970ca2.js but index.html different :( <script src="dist/app.174d0b0d04495cf7a970e84cc9a96cdb.js"></script>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!